home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / misc / unixmode.lzh / UNIXMODE.doc
Text File  |  1990-11-21  |  15KB  |  321 lines

  1. The UNIXMODE Extended Filename Standard
  2.  
  3.  
  4. 0. Summary
  5.  
  6. The UNIXMODE extended filename standard provides a uniform, user-controlled
  7. way of mapping the user's name for files (which need not conform to the
  8. GEMDOS restrictions on length and case) to the names by which GEMDOS
  9. knows them. It is intended to be as compatible as possible, e.g. whenever
  10. reasonable the GEMDOS name of a file should match the name that GEMDOS would
  11. have assigned to the name by it's usual conversions. File names with
  12. multiple extensions are permitted by translating the '.' character to a
  13. user-specified replacement (e.g. '_'). Long file names, and file names
  14. with mixed upper and lower case, are represented by entries in a special
  15. file, ".dir". This file also contains entries for Unix-like symbolic links.
  16. Programs use the ".dir" files in the appropriate directories to translate
  17. file names to/from GEMDOS. All translations are controlled by the user
  18. through the environment variable UNIXMODE.
  19.  
  20.  
  21. 1. Rationale
  22.  
  23. GEMDOS filenames are limited to an 8 character name plus a 3 character
  24. extension. The names must be all upper case, and must not contain certain
  25. characters (such as ' ' and '.'). Many other popular operating systems,
  26. most notably Unix, have much more flexible naming conventions. Moving files
  27. from computers running such operating systems to an Atari ST can sometimes
  28. present problems.
  29.  
  30. Moreover, short filenames are sometimes not very descriptive at all. Having
  31. longer filenames, with fewer restrictions, makes remembering what's in the
  32. files *much* easier.
  33.  
  34.  
  35. 2. The Proposal
  36.  
  37. We're stuck with GEMDOS's rules, at least for the time being. However, there's
  38. nothing preventing programs from storing extra information about filenames.
  39. Thus, a program could know that when the user refers to "govt.letter.april1"
  40. to actually use the file "GOVTLET.AP1".
  41.  
  42. The UNIXMODE extended filename standard provides a uniform method of
  43. associating long filenames with shorter, GEMDOS compatible filenames. 
  44. "UNIXMODE" is the name of an environment variable. This variable contains
  45. information about how the user wishes file names to be mapped. File name
  46. mapping can be turned off completely, or altered to reflect changes in
  47. the file system. Thus, programs using the UNIXMODE standard will still work
  48. correctly in future versions of GEMDOS (or GEMDOS emulators) which allow
  49. longer or otherwise more flexible file names. Also, UNIXMODE standard programs
  50. do not impose their will on the user; the user controls whether or not,
  51. and how, extended filename mapping is performed.
  52.  
  53. Programs that use the UNIXMODE standard can allow file names up to 31
  54. characters in length. These file names may be mixed upper and lower case,
  55. with periods and even spaces in them (although the latter is not recommended).
  56. The only characters *not* permitted in file names are the null, tab,
  57. newline, and carriage return characters.
  58.  
  59. The UNIXMODE standard also provides for symbolic links. These are special
  60. directory entries that "point to" other directory entries. They provide
  61. an easy way to reference the same file under more than one name. For
  62. example, if there are several versions of a document under revision
  63. simultaneously, a symbolic link called, say, "current" could point to
  64. the most current version. An editor that followed the UNIXMODE standard
  65. could be invoked by, say, "edit current" and would correctly retrieve the
  66. current version.
  67.  
  68. In fact, under the UNIXMODE standard, long or otherwise unusual file names
  69. are implemented by a special kind of symbolic link, the "automatic"
  70. symbolic links. These links (also called "aliases") are used in mapping
  71. long file names to ones that GEMDOS understands. If the user has made
  72. provisions for allowing automatic links (see below), then every time a
  73. file is created whose name is not acceptable to GEMDOS, then the file's
  74. name is modified to be acceptable, and a symbolic link with the user's
  75. preferred name for the file is created.
  76.  
  77.  
  78. 3 Filename Translations
  79.  
  80. Programs that follow the UNIXMODE standard will translate file names in
  81. certain standard ways. These translations may be over-ridden by various
  82. options in the UNIXMODE environment variable, but in general it is best
  83. *not* to override them.
  84.  
  85. When translating from user names to GEMDOS names:
  86. (a) if a symbolic link is found with the same name as the user name,
  87.     it is used.
  88. (b) the character '/' may be converted to '\', depending on user options
  89. (c) filenames are converted to upper case
  90. (d) occurrences of the character '.' may be converted to a user-
  91.     specified character, to prevent conflict with GEMDOS
  92.     restrictions on extensions
  93. (e) filenames are truncated to have an (at most) 8 character base and an
  94.     (at most) 3 character extension.
  95.  
  96. When translating from GEMDOS names to user names (e.g. printing the name
  97. of the current directory):
  98.  
  99. (a) '\' may be converted to '/'
  100. (b) if an automatic symbolic link exists to the file, then that name
  101.     is used instead of the file name
  102. (b) filenames are converted to lower case
  103. (c) occurrences of the user-specified replacement character for '.'
  104.     are converted back to '.'.
  105.  
  106. If the user name is not already a symbolic link, and the conversion from
  107. user->GEMDOS->user again would change the name, then an automatic symbolic
  108. link may be created for the file name. This allows the user to refer
  109. to the file by its full name, and also allows the program to print the
  110. name by which the user wishes to refer to the file, rather than the name by
  111. which GEMDOS knows the file.
  112.  
  113. Examples:
  114. If all of the above mappings are asked for by the user, and the user
  115. specifies the character '_' as the replacement for '.', then
  116.  
  117. user name:        becomes:
  118. foo.bar            FOO.BAR
  119. foo.bar.c        FOO_BAR.C
  120. longname1.extension    LONGNAME.EXT        *
  121. ReadMe            README            *
  122. a_file.doc        A_FILE.DOC        *
  123.  
  124. In the cases marked (*), the user name is not recoverable from the GEMDOS
  125. name. In these cases, programs should (if the user requests it) create
  126. automatic symbolic links from the user name to the GEMDOS name; such links
  127. will allow programs to properly recover the user's desired name for the files
  128. in directory listings, etc.
  129.  
  130. 3.1 The UNIXMODE Environment Variable
  131.  
  132. The environment variable UNIXMODE contains the user's preferences for
  133. file name mapping. Each character in the environment variable string
  134. represents one of the options below. If the UNIXMODE variable is not
  135. found in the environment, programs may assume whatever defaults are
  136. appropriate. It is recommended that symbolic links *not* be active by
  137. default. The empty string is a reasonable default, providing complete
  138. GEMDOS compatibility. The GNU C library assumes a default of "/", for
  139. compatibility with old code.
  140.  
  141. The characters in the UNIXMODE string have the following meanings:
  142. (characters inside of angle brackets <> are supplied by the user; thus
  143. "r<c>" means the letter "r" followed by any other character, which will
  144. be referred to in the text as "<c>")
  145.  
  146. /    -- Allow the use of '/' as well as '\' to separate the directories
  147.        in a path name. If the "/" option is given, then the name
  148.        "foo/bar" refers to the file "BAR" in the directory "FOO".
  149.        Otherwise (the default) it refers to the file "FOO/BAR" in the
  150.        current directory.
  151.  
  152. .<c>    -- Translate multiple uses of the '.' character to the
  153.        character <c>. Normally, GEMDOS allows only one '.' in a
  154.        file name, and it introduces the extension. This option allows
  155.        extra extensions. All but one (or perhaps even all) '.' characters
  156.        are converted into <c>. At most one '.' will be left; this will be
  157.        chosen to minimize the number of characters lost to the 8+3 rule
  158.        (unless the "u" option is in force, see below).
  159.  
  160.        Example: if "._" is found in the UNIXMODE string, then the
  161.        following translations will occur:
  162.         foo.c.z    becomes  FOO.C_Z
  163.             foo.c.bak  becomes  FOO_C.BAK
  164.         a.b.c.d    becomes  A_B.C_D
  165.         foo.bar    remains  FOO.BAR
  166.         .login       becomes  _LOGIN  (rather than ".LOG")
  167.  
  168.        If the "." option is present, programs should convert filenames
  169.        back to what the user expected, e.g. in the above, "A_B.C_D"
  170.        should be displayed to the user as "a.b.c.d".
  171.        Note that if a file name would contain the character <c> used
  172.        for mapping '